import request from '@/config/axios'

export interface BookVO {
  id: number
  name: string
  isbn: string
  englishName: string
  batchNumber: string
}

export interface UpdateStatusReqVO {
  id: number
  status: number
}

// 查询丛书列表
export const getBookPage = async (params: PageParam) => {
  return await request.get({ url: '/system/book/page', params })
}

// 查询丛书详情
export const getBook = async (id: number) => {
  return await request.get({ url: '/system/book/get?id=' + id })
}

// 新增丛书
export const createBook = async (data: BookVO) => {
  return await request.post({ url: '/system/book/create', data })
}

// 修改丛书
export const updateBook = async (data: BookVO) => {
  return await request.put({ url: '/system/book/update', data })
}

// 删除丛书
export const deleteBook = async (id: number) => {
  return await request.delete({ url: '/system/book/delete?id=' + id })
}
